//
//  MaskView.m
//  03-17hitTest应用
//
//  Created by student on 16/3/17.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "MaskView.h"

@implementation MaskView

-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
    //判断触摸点是不是在按钮的范围内
    
    CGPoint btnPoint=[self convertPoint:point toView:self.button];
    if ([self.button pointInside:btnPoint withEvent:event]) {
        return self.button;
    }
    else{
        return [super hitTest:point withEvent:event];
    }
}

@end
